import styles from './styles.less';
import SearchForm from './components/SearchForm';
import DataTable from './components/DataTable';
import {useState} from 'react';
import DataForm from './components/DataForm';
import LocationForm from './components/LocationForm';
import Payways from './components/payways/App';
import Users from './components/users/App';
import Sperkers from './components/speakers/App';
import Detail from "./components/Detail";


const App = () => {

  const [tablePayload, setTablePayload] = useState({pageNum: 1, pageSize: 15, param: {}});
  const [detail, setDetail] = useState(undefined);
  const [dataForm, setDataForm] = useState(undefined);
  const [payways, setPayways] = useState(undefined);
  const [users, setUsers] = useState(undefined);
  const [speakers, setSpeakers] = useState(undefined);
  const [locationForm, setLocationForm] = useState(undefined);

  return (
    <div className={styles.myContainer}>
      <Payways data={{payways, setPayways}}/>
      <Users data={{users, setUsers}}/>
      <Sperkers data={{speakers, setSpeakers}}/>
      <Detail data={{detail, setDetail}}/>
      <DataForm data={{dataForm, setDataForm, tablePayload, setTablePayload}}/>
      <LocationForm data={{locationForm, setLocationForm, tablePayload, setTablePayload}}/>
      <SearchForm data={{tablePayload, setTablePayload}}/>
      <DataTable data={{setLocationForm, setDetail, setDataForm, tablePayload, setTablePayload, setPayways, setUsers, setSpeakers}}/>
    </div>
  );
};

export default App;
